const ScriptUtils = {
    /**
     * 异步加载脚本
     * @param url 脚本地址
     * @returns {Promise<void>}
     */
    loadScript(url) {
        return new Promise(resolve => {
            let scriptElement = document.createElement('script');
            scriptElement.characterSet = 'utf-8';
            scriptElement.src = url;
            document.head.appendChild(scriptElement);
            scriptElement.onload = resolve;
        });
    }
};

export default ScriptUtils;